package cn.xiaohui;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class ExampleTest50 {

	public static void main(String[] args) throws Exception{
				FileReader reader=new FileReader("text.txt");
				//建立缓冲区 缓冲对象
				BufferedReader bufferedReader = new BufferedReader(reader);
				
				FileWriter writer = new FileWriter("writer1.txt");
				BufferedWriter bufferedWriter = new BufferedWriter(writer);
				
				String string;//用于存储每个字符
				while((string = bufferedReader.readLine())!=null) {
					bufferedWriter.write(string);
					bufferedWriter.newLine();//写入换行符
				}
				bufferedReader.close();
				bufferedWriter.close();
	}
}